<?php

/*
 * 站点逻辑关系
 * free_dream 2014.4.10
 */

namespace Admin\Logic;

use Think\Controller;

class SiteLogic extends Controller {

    public $site;

    public function _initialize() {
        $this->site = M('Site');
    }

    public function getSite($where=NULL,$order='sort,id desc',$field=null,$type) {
        $item_site = $this->site->where($where)->order($order)->select();
        if($type)
            return $item_site;
        else
            $this->assign('item_site', $item_site);
    }
    
    public function showContentSite($map,$type){

        $siteCategory = M('SiteCategory');
        $item_site_category = $siteCategory->where($map)->field('cate_id as id,pid,title')->order('id')->select();
        $item_site_category = list_to_tree($item_site_category);
        if($type)
            return $item_site_category;
        else
            $this->assign('item_site_category', $item_site_category);
        
    }

}
